package com.gaogzhen.config;

import com.gaogzhen.geetest.GeetestLib;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Administrator
 * @version 1.0
 * @description 极验自动配置
 * @date 2022-06-25 10:44
 */
@Configuration
@EnableConfigurationProperties(GeetestProperties.class)
public class GeetestAutoConfiguration {
    private GeetestProperties geetestProperties;

    public GeetestAutoConfiguration(GeetestProperties geetestProperties) {
        this.geetestProperties = geetestProperties;
    }

    @Bean
    public GeetestLib geetestLib() {
        return new GeetestLib(geetestProperties.getGeetestId(), geetestProperties.getGeetestKey());
    }
}
